<h1 id="titlename">添加作品</h1>
<div class="clear">
    <div class="row">
        <div class="col-sm-8 col-sm-offset-1">
            <div class="col-sm-10 col-sm-offset-2">
            <div <?php $err = validation_errors(); echo !(empty($error) && empty($err)) ? 'class="alert alert-danger text-center"' : '' ?>><?php echo validation_errors(); ?>
                <?php echo $error ?></div>
            </div>

    <?php echo form_open_multipart('poster_admin/upload', array('class'=>'form-horizontal','role'=>'form'));?>
         <div class="form-group">
            <label for="title" class="col-sm-3 control-label">作品名</label>
             <div class="col-sm-9">
            <input type="text" name="title" class="form-control" id="title" size="20" placeholder="作品名"/>
            </div>
         </div>
        <div class="form-group">
            <label for="realname" class="col-sm-3 control-label">真实姓名</label>
            <div class="col-sm-9">
            <input type="text" name="realname" id="realname" class="form-control" size="20" placeholder="真实姓名"/>
            </div>
        </div>
        <div class="form-group">
            <label for="studentnum" class="col-sm-3 control-label">学号</label>
            <div class="col-sm-9">
            <input type="text" name="studentnum" id="studentnum" class="form-control" size="20" placeholder="学号"/>
            </div>
        </div>
        <div class="form-group">
            <label for="college" class="col-sm-3 control-label">学院</label>
            <div class="col-sm-9">
                <select class="form-control" name="college" id="college">
                    <?php
                        foreach($college as $value)
                            echo '<option value="' . $value['id'] . '">' . $value['name'] . '</option>';
                    ?>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label for="category" class="col-sm-3 control-label">竞赛项目</label>
            <div class="col-sm-9">
                <select class="form-control" name="category" id="category">
                    <?php
                    foreach($category as $value)
                        echo '<option value="' . $value['id'] . '">' . $value['category'] . '</option>';
                    ?>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label for="content" class="col-sm-3 control-label">作品介绍</label>
            <div class="col-sm-9">
                <textarea name="content" id="content" placeholder="请输入作品介绍" class="form-control" rows="10"></textarea>
            </div>
        </div>
        <div class="form-group">
            <label for="userfile" class="col-sm-3 control-label">上传</label>
            <div class="col-sm-9">
        <input type="file"  class="btn btn-info" id="userfile" name="userfile" size="20" />
                <span class="help-block">仅限png,jpg,gif格式</span>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <input type="submit"  class="btn btn-primary btn-block btn-lg" value="提交并上传" />
            </div>
        </div>
            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-10">
                    <a href="<?php echo base_url().'poster_admin/works'?>"><button type="button" class="btn btn-default btn-lg btn-block">返回到列表</button></a>
                </div>
            </div>

            </form>
       </div>
    </div>
</div>